package com.mybpm.core.instance

import com.mybpm.core.definition.Process
import grails.compiler.GrailsCompileStatic
import groovy.transform.ToString

/**
 * 流程实例
 */
@GrailsCompileStatic
@ToString(includes = 'id,title', includeNames = true, includePackage = false)
class ProcessInstance {
    /** 流程定义id */
    String pid
    /** 流程显示名称 */
    String displayName
    /** 流程类型 */
    String type
    /** 版本号：三段式(xxx.xxx.xxx) */
    String revision
    /** 流程实例的标题 */
    String title
    /** 起草人id */
    String createrId
    /** 起草人姓名 */
    String createrName

    Date dateCreated;
    Date lastUpdated;

    static belongsTo = [process: Process]

    static constraints = {
        pid nullable: false, blank: false, length: 200
        displayName nullable: true, length: 100
        type nullable: true, length: 50
        revision nullable: true, length: 50
        title nullable: true, length: 200
        createrId nullable: true, length: 100
        createrName nullable: true, length: 100
    }

    static mapping = {
        table 'bpm_i_process'
        version false
    }

}
